{% load state_display %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../../static/personal_center/font_2369197_oqktwkt71s/iconfont.css" media="screen">
    <link rel="stylesheet" href="../../static/public_file/css/DepartmentSelection.css">
    <title>Title</title>
    <style>
        body, html {
            padding: 0px;
            margin: 0px;
            width: 100%;
            height: 100%;
        }
        .input-style {
            display: inline-block;
            width: 100%;
            height: 35px;
            font-size: 14px;
            border: none;
            background: white;
        }
        table {
            border-collapse: collapse;
            border-spacing: 0;
        }
        tr {
            height: 35px;
        }

        th {
            text-align: center;
        }
        td {
            padding-right: 0.5%;
        }
        .top_tag {
            border-bottom: #01AAED solid 2px;
            color: #01AAED;
        }

        .tab_top {
            width: 100px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            display: inline-block;
            cursor: pointer;
        }

        .a_tag_cla{
            display: block;
            /*超出隐藏*/
            overflow: hidden;
            /*禁止换行*/
            white-space: nowrap;
            /*超出用省略号代替*/
            text-overflow: ellipsis;height: 30px;line-height: 30px;padding-left: 1%;
        }

        .file {
            position: relative;
            display: inline-block;
            background: #D0EEFF;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: #1E88C7;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
        }

        .file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
        }

        .file:hover {
            background: #AADFFD;
            border-color: #78C3F3;
            color: #004974;
            text-decoration: none;
        }
        #loading { background: #fff url(../../static/public_file/images/jiazai.gif) no-repeat scroll center center; height: 100%; width: 100%; background-size: 10%; position: fixed; margin-top: 0px; top: 0px; left: 0px; bottom: 0px; overflow: hidden !important; right: 0px; z-index: 999999;background-color: rgba(255, 255, 255, 0.08);}

    </style>
</head>
<body>
    <div id="loading">
        <div id="loading-center">
        </div>
    </div>

    <div style="width: 100%;height: 40px;background: white;border-bottom: #cfcfcf solid 0.5px;line-height: 40px;color: black;">
        <div id="DW_tag" class="tab_top top_tag" onclick="change_mind('DW')">
            申请详情
        </div>
        <div id="LH_tag" class="tab_top" onclick="change_mind('LH')">
            附件
        </div>
        <div id="lct_tag" class="tab_top" onclick="change_mind('lct')">
            流程图
        </div>
        <button onclick="ExportCar()" style="float: right;width: 100px;height: 30px;line-height: 30px;margin-top: 5px;border-radius: 3px;border: #1E90FF solid 0.5px;background-color: #1E90FF;color: white;cursor: pointer;margin-right: 15px;">提交</button>

        <div style="width: 110px;float: right;text-align: center;height: 40px;">
            <button style="line-height: 27px;border-radius: 3px;border: #1E90FF solid 0.5px;width: 100px;height: 30px;margin-top: 5px;background: #1E90FF;color: white;"><a href="javascript:history.go(-1)" style="color: white;">返回</a></button>
        </div>
    </div>

    <div id="DW" style="width: 100%;height: 95%;background: white;overflow: auto;">
        <div id="menu_from"
             style="width: 100%;height: 100%;color: #2C3E50;display: inline-block;vertical-align: top;background: white;">
            <div style="width: 100%;height: 90%;display: inline-block;vertical-align: center;margin-top: 1.5%;">
                <div style="width: 95%;margin-left: 2.5%;">
                    <table style="width: 100%;">
                        <tr>
                            <td colspan="4" style="width: 100%;height: 40px;padding-left: 0.5%;line-height: 40px;border: #cfcfcf solid 1px;text-align: center;">
                                <h3 id="form_name" style="letter-spacing: 8px;">经济合同会签流程</h3>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="4" style="width: 100%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #dfdfdf;border-left: #cfcfcf solid 0.5px;border-right: #cfcfcf solid 0.5px;">
                                基本信息
                            </td>
                        </tr>
                        <tr style="margin-left: 1%;">
                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;">
                                申请人
                            </td>
                            <td id="applicat"
                                style="width: 35%;height: 35px;line-height: 35px;padding-left: 1%;border: #cfcfcf solid 0.5px;">{{ obj.apply_user.real_name }}</td>
                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;border-bottom: none;">
                                填表时间
                            </td>
                            <td id="date"
                                style="width: 35%;border: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;border-bottom: none;">{{ obj.create_time | date:"Y-m-d H:i" }}
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;">
                                立&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;项&nbsp;&nbsp;&nbsp;&nbsp;科&nbsp;&nbsp;&nbsp;&nbsp;室
                            </td>
                            <td id="department" colspan="3"
                                style="width: 85%;border: #cfcfcf solid 0.5px;padding-left: 1%;line-height: 35px;">{{ obj.company.name }}</td>
                        </tr>
                    </table>
                </div>
                <div style="width: 95%;margin-left: 2.5%;;">
                    <table style="width: 100%;">
                        <tr>
                            <td colspan="4" style="width: 100%;height: 40px;padding-left: 0.5%;line-height: 40px;background: #dfdfdf;border-left: #cfcfcf solid 0.5px;border-right: #cfcfcf solid 0.5px;">
                                申请详情
                            </td>
                        </tr>
                        <tr style="margin-left: 1%;">
                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;border-bottom: none;">
                                用&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;印&nbsp;&nbsp;&nbsp;&nbsp;份&nbsp;&nbsp;&nbsp;&nbsp;数
                            </td>
                            <td id="Printing" style="width: 35%;border: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;border-bottom: none;" contenteditable="{{ is_edit }}">{{ obj.Printing }}
                            </td>
                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;border-bottom: none;">
                                物资需求科室
                            </td>
                            <td id="product_company" style="width: 35%;border: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;border-bottom: none;" {% if is_edit == 'true' %} onclick="show_office_model()" {% endif %} name="{{ xuqiu_id_str }}">
                                {{ xuqiu_dep_str }}
                            </td>

                        </tr>
                    </table>
                    <table style="width: 100%;">
                        <tr style="margin-left: 1%;">
                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;border-bottom: none;">
                                合&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;同&nbsp;&nbsp;&nbsp;&nbsp;名&nbsp;&nbsp;&nbsp;&nbsp;称
                            </td>
                            <td id="contract_name"
                                style="width: 35%;border: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;border-bottom: none;"
                                contenteditable="{{ is_edit }}">{{ obj.contract_name }}
                            </td>
                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;border-bottom: none;letter-spacing: 8px;">
                                合同编号
                            </td>
                            <td id="contract_number"
                                style="width: 35%;border: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;border-bottom: none;"
                                contenteditable="{{ is_edit }}">{{ obj.contract_number }}
                            </td>

                        </tr>
                    </table>
                    <table style="width: 100%;">
                        <tr style="margin-left: 1%;">
                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;border-bottom: none;">
                                合&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;同&nbsp;&nbsp;&nbsp;&nbsp;类&nbsp;&nbsp;&nbsp;&nbsp;型
                            </td>
                            <td id="documentation" style="width: 35%;border: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;border-bottom: none;">
                                {% if is_edit == 'true' %}
                                    <select style="width: 100%;height: 95%;border: none;outline: none;" onchange="choose_contract()" name="" id="contract_type">
                                        <option value="0" {% if obj.contract_type == '0' %} selected {% endif %}>请选择合同类型</option>
                                        <option value="1" {% if obj.contract_type == '1' %} selected {% endif %}>服务类</option>
                                        <option value="2" {% if obj.contract_type == '2' %} selected {% endif %}>货物类</option>
                                        <option value="3" {% if obj.contract_type == '3' %} selected {% endif %}>工程类</option>
                                        <option value="4" {% if obj.contract_type == '4' %} selected {% endif %}>其它类</option>
                                    </select>
                                {% else %}
                                    {% if obj.contract_type == '0' %}
                                        请选择合同类型
                                    {% elif obj.contract_type == '1' %}
                                        服务类
                                    {% elif obj.contract_type == '2' %}
                                        货物类
                                    {% elif obj.contract_type == '3' %}
                                        工程类
                                    {% else %}
                                        其它类
                                    {% endif %}
                                {% endif %}
                            </td>

                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;border-bottom: none;letter-spacing: 8px;">
                                对方单位
                            </td>
                            <td id="other_units"
                                style="width: 35%;border: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;border-bottom: none;"
                                contenteditable="{{ is_edit }}">{{ obj.other_units }}
                            </td>
                        </tr>
                        <tr id="contract_date" style="margin-left: 1%;{% if obj.contract_type == '0' or obj.contract_type == '2' or obj.contract_type == '3' or obj.contract_type == '4' %} display: none; {% endif %}">
                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;letter-spacing: 1.8px;border-bottom: none;">
                                合&nbsp;&nbsp;同&nbsp;&nbsp;生&nbsp;&nbsp;效&nbsp;&nbsp;日
                            </td>
                            <td {% if is_edit == 'true' %} id="contract_effect" {% endif %} style="width: 35%;border: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;border-bottom: none;cursor: pointer;">{{ obj.contract_effect }}</td>

                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;letter-spacing: 4px;border-bottom: none;">
                                合同截止日
                            </td>
                            <td {% if is_edit == 'true' %} id="contract_off" {% endif %} style="width: 35%;border: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;border-bottom: none;cursor: pointer;">{{ obj.contract_off }}</td>
                        </tr>
                    </table>
                    <table style="width: 100%;">
                        <tr style="margin-left: 1%;">
                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;">
{#                                合&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;同&nbsp;&nbsp;&nbsp;&nbsp;金&nbsp;&nbsp;&nbsp;&nbsp;额#}
                                合 同 金 额（元）
                            </td>
                            <td id="contract_amount" style="width: 35%;border: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;" {% if is_edit == 'true' %} onblur="isChinese(this.innerText)" {% endif %} contenteditable="{{ is_edit }}">{{ obj.contract_amount }}

                            </td>
                            <td style="width: 15%;border: #cfcfcf solid 0.5px;text-align: right;height: 35px;line-height: 35px;letter-spacing: 8px;">
                                经费来源
                            </td>
                            <td id="source"
                                style="width: 35%;border: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;"
                                contenteditable="{{ is_edit }}">{{ obj.source }}
                            </td>
                        </tr>
                        {% if is_edit == 'true' %}
                            <tr id="shifoudayu" style="margin-left: 1%;display: none;">
                                <td style="width: 15%;border-right: #cfcfcf solid 0.5px;border-left: #cfcfcf solid 0.5px;border-bottom: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;text-align: right;letter-spacing: 2.5px;">
                                    是否大于20万元
                                </td>
                                <td id="greater_than" colspan="3" style="width: 85%;border-right: #cfcfcf solid 0.5px;border-left: #cfcfcf solid 0.5px;border-bottom: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;">
                                    <input type="radio" name="greater" value="1" {% if obj.greater == "1" %}checked{% endif %} {% if is_edit == 'false' %}disabled{% endif %}> 是
                                    <input type="radio" name="greater" value="0" {% if obj.greater == "0" %}checked{% endif %} style="margin-left: 10px;" {% if is_edit == 'false' %}disabled{% endif %}> 否
                                </td>
                            </tr>
                        {% endif %}
                    </table>
                    <table style="width: 100%;">
                        <tr style="margin-left: 1%;">
                            <td style="width: 15%;border-right: #cfcfcf solid 0.5px;border-left: #cfcfcf solid 0.5px;border-bottom: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;text-align: right;">
                                合同内容主要条款
                            </td>
                            <td id="content"
                                style="width: 85%;border-right: #cfcfcf solid 0.5px;border-left: #cfcfcf solid 0.5px;border-bottom: #cfcfcf solid 0.5px;height: 35px;line-height: 35px;padding-left: 1%;"
                                contenteditable="{{ is_edit }}">{{ obj.content }}</td>
                        </tr>
                    </table>

                </div>
                <div style="width: 95%;margin-left: 2.5%;">
                    <table style="width: 100%;">
                        <tr>
                            <td colspan="2" style="height: 40px;padding-left: 0.5%;line-height: 40px;background: #dfdfdf;border: #cfcfcf solid 0.5px;border-top: none;">
                                审批详情
                            </td>
                        </tr>
                        {% if 'one' in audit_dic %}
                            <tr id="fzrcs_tr" style="width: 100%;{% if obj.is_leader == True %} display: none{% endif %}">
                                <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                    申请科室负责人审核
                                </td>
                                <td id="fzrcs"
                                    style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                                    {% for k,v in audit_dic.items %}
                                        {% if k == 'one' %}
                                            {% for item in v %}
                                                {% if item.state != 'unaudit' %}
                                                    <div id="fzrcs_op"
                                                         style="width: 100%;line-height: 20px;position: relative;">
                                                        <span>{{ item.state_display }}</span>
                                                        <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                    </div>
                                                    <div>
                                                        <img src="{{ item.signature_picture }}" alt=""
                                                             style="width: 150px; height: 60px;">
                                                    </div>
                                                    <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                                {% endif %}
                                            {% endfor %}
                                        {% endif %}
                                    {% endfor %}
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'two' in audit_dic %}
                            <tr id="fgld_tr" style="width: 100%;">
                                <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                    物资需求科室负责人审批
                                </td>
                                <td id="fgld"
                                    style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                                    {% for k,v in audit_dic.items %}
                                        {% if k == 'two' %}
                                            {% for item in v %}
                                                {% if item.state != 'unaudit' %}
                                                    <div style="width: 100%;line-height: 20px;position: relative;">
                                                        <span>{{ item.state_display }}</span>
                                                        <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                    </div>
                                                    <div>
                                                        <img src="{{ item.signature_picture }}" alt=""
                                                             style="width: 150px; height: 60px;">
                                                    </div>
                                                    <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                                {% endif %}
                                            {% endfor %}
                                        {% endif %}
                                    {% endfor %}
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'three' in audit_dic %}
                            <tr id="three_tr" style="width: 100%;">
                                <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                    财&nbsp;务&nbsp;科&nbsp;负&nbsp;责&nbsp;人&nbsp;审&nbsp;批
                                </td>
                                <td id="three"
                                    style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                                    {% for k,v in audit_dic.items %}
                                        {% if k == 'three' %}
                                            {% for item in v %}
                                                {% if item.state != 'unaudit' %}
                                                    <div style="width: 100%;line-height: 20px;position: relative;">
                                                        <span>{{ item.state_display }}</span>
                                                        <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                    </div>
                                                    <div>
                                                        <img src="{{ item.signature_picture }}" alt=""
                                                             style="width: 150px; height: 60px;">
                                                    </div>
                                                    <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                                {% endif %}
                                            {% endfor %}
                                        {% endif %}
                                    {% endfor %}
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'four' in audit_dic %}
                            <tr id="four_tr" style="width: 100%;">
                                <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                    监&nbsp;察&nbsp;室&nbsp;负&nbsp;责&nbsp;人&nbsp;审&nbsp;批
                                </td>
                                <td id="four"
                                    style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                                    {% for k,v in audit_dic.items %}
                                        {% if k == 'four' %}
                                            {% for item in v %}
                                                {% if item.state != 'unaudit' %}
                                                    <div style="width: 100%;line-height: 20px;position: relative;">
                                                        <span>{{ item.state_display }}</span>
                                                        <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                    </div>
                                                    <div>
                                                        <img src="{{ item.signature_picture }}" alt=""
                                                             style="width: 150px; height: 60px;">
                                                    </div>
                                                    <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                                {% endif %}
                                            {% endfor %}
                                        {% endif %}
                                    {% endfor %}
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'five' in audit_dic %}
                            <tr id="five_tr" style="width: 100%;">
                                <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                    审&nbsp;计&nbsp;科&nbsp;负&nbsp;责&nbsp;人&nbsp;审&nbsp;批
                                </td>
                                <td id="five"
                                    style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                                    {% for k,v in audit_dic.items %}
                                        {% if k == 'five' %}
                                            {% for item in v %}
                                                {% if item.state != 'unaudit' %}
                                                    <div style="width: 100%;line-height: 20px;position: relative;">
                                                        <span>{{ item.state_display }}</span>
                                                        <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                    </div>
                                                    <div>
                                                        <img src="{{ item.signature_picture }}" alt=""
                                                             style="width: 150px; height: 60px;">
                                                    </div>
                                                    <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                                {% endif %}
                                            {% endfor %}
                                        {% endif %}
                                    {% endfor %}
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'six' in audit_dic %}
                            <tr id="six_tr" style="width: 100%;">
                                <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 1.7px;">
                                    分&nbsp;&nbsp;管&nbsp;&nbsp;领&nbsp;&nbsp;导&nbsp;&nbsp;签&nbsp;&nbsp;字
                                </td>
                                <td id="six"
                                    style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                                    {% for k,v in audit_dic.items %}
                                        {% if k == 'six' %}
                                            {% for item in v %}
                                                {% if item.state != 'unaudit' %}
                                                    <div style="width: 100%;line-height: 20px;position: relative;">
                                                        <span>{{ item.state_display }}</span>
                                                        <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                    </div>
                                                    <div>
                                                        <img src="{{ item.signature_picture }}" alt=""
                                                             style="width: 150px; height: 60px;">
                                                    </div>
                                                    <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                                {% endif %}
                                            {% endfor %}
                                        {% endif %}
                                    {% endfor %}
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'nine' in audit_dic %}
                            <tr id="seven_tr" style="width: 100%;">
                                <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                    {% if obj.greater == "1" %}
                                        书&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;记&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;签&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;字
                                    {% else %}
                                        院&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;长&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;签&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;字
                                    {% endif %}
                                </td>
                                <td id="seven"
                                    style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                                    {% for k,v in audit_dic.items %}
                                        {% if k == 'nine' %}
                                            {% for item in v %}
                                                {% if item.state != 'unaudit' %}
                                                    <div style="width: 100%;line-height: 20px;position: relative;">
                                                        <span>{{ item.state_display }}</span>
                                                        <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                    </div>
                                                    <div>
                                                        <img src="{{ item.signature_picture }}" alt=""
                                                             style="width: 150px; height: 60px;">
                                                    </div>
                                                    <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                                {% endif %}
                                            {% endfor %}
                                        {% endif %}
                                    {% endfor %}
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'ten' in audit_dic %}
                            <tr id="eight_tr" style="width: 100%;">
                                <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;">
                                    法&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;人&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;签&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;字
                                </td>
                                <td id="eight"
                                    style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                                    {% for k,v in audit_dic.items %}
                                        {% if k == 'ten' %}
                                            {% for item in v %}
                                                {% if item.state != 'unaudit' %}
                                                    <div style="width: 100%;line-height: 20px;position: relative;">
                                                        <span>{{ item.state_display }}</span>
                                                        <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                    </div>
                                                    <div>
                                                        <img src="{{ item.signature_picture }}" alt=""
                                                             style="width: 150px; height: 60px;">
                                                    </div>
                                                    <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                                {% endif %}
                                            {% endfor %}
                                        {% endif %}
                                    {% endfor %}
                                </td>
                            </tr>
                        {% endif %}

                        {% if 'eleven' in audit_dic %}
                            <tr id="six_tr" style="width: 100%;">
                                <td style="width: 15%;height: 150px;border: #cccccc solid 1px;text-align: right;padding-right: 1%;border-top: none;letter-spacing: 1.7px;">
                                    党&nbsp;政&nbsp;办&nbsp;审&nbsp;核&nbsp;盖&nbsp;章
                                </td>
                                <td id="eleven"
                                    style="width: 85%;height: 150px;border: #cccccc solid 1px;border-left: none;border-top: none;">
                                    {% for k,v in audit_dic.items %}
                                        {% if k == 'eleven' %}
                                            {% for item in v %}
                                                {% if item.state != 'unaudit' %}
                                                    <div style="width: 100%;line-height: 20px;position: relative;">
                                                        {% if item.state_display == '同意' %}
                                                            已审核
                                                        {% else %}
                                                            <span>{{ item.state_display }}</span>
                                                        {% endif %}
                                                        <span style="margin-left: 3%">{{ item.audit_note }}</span>
                                                    </div>
                                                    <div>
                                                        <img src="{{ item.signature_picture }}" alt=""
                                                             style="width: 150px; height: 60px;">
                                                    </div>
                                                    <div style="text-align: right;color: #0b0b0b;">{{ item.audit_time }}</div>
                                                {% endif %}
                                            {% endfor %}
                                        {% endif %}
                                    {% endfor %}
                                </td>
                            </tr>
                        {% endif %}
                    </table>
                </div>
                <div style="width: 95%;margin-left: 2.5%; {% if is_edit == 'false' %}display: none{% endif %}">
                    <div style="width: 100%;height: 40px;line-height: 40px;background-color: #F5F5F5;color: #1E90FF;padding-left: 1%;border: #cccccc solid 1px;border-top: none;border-bottom: none;padding-right: 1%;">
                        上传附件
                        <a href="javascript:;" class="file" style="vertical-align: top;margin-top: 5px;float: right;">
                            上传文件
                            <input type="file" name="party_main_body" id="party_main_body"
                                   onchange="upload_accessory('file1', 'party_main', 'party_main_body')">
                        </a>
                    </div>
                    <table style="width: 100%;">
                        <thead>
                        <tr>
                            <td style="width: 5%;border: #cccccc solid 1px;text-align: center;">序号</td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                文件名称
                            </td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                文件大小
                            </td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                上传时间
                            </td>
                            <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                上传人员
                            </td>
                            <td style="width: 15%;border: #cccccc solid 1px;border-left: none;text-align: center;">操作
                            </td>
                        </tr>
                        </thead>
                        <tbody style="overflow: auto;" id="party_main">
                        {% for record in file_list %}
                            <tr>
                                <td style="width: 5%;border: #cccccc solid 1px;text-align: center;">{{ forloop.counter }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.file_name }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.file_size }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.upload_time }}</td>
                                <td style="width: 20%;border: #cccccc solid 1px;border-left: none;text-align: center;">{{ record.uploader }}</td>
                                <td style="width: 15%;border: #cccccc solid 1px;border-left: none;text-align: center;">
                                    <a target='_blank' href="{{ record.file_path }}">查看</a> | <a style="color: red;"
                                                                                                 href='#'
                                                                                                 onclick='RemoveTr(this, {{ record.id }})'>删除</a>
                                </td>
                            </tr>
                        {% endfor %}
                        </tbody>

                    </table>
                </div>
            </div>

        </div>
    </div>

    <div id="LH" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="display: inline-block;width: 20%;vertical-align: top;height: 99%">
            <div style="width: 100%;height: 40px;background: #c8cbcf;padding-left: 2%;line-height: 40px;color: #0c6fd9;">
                附件
            </div>
            <div id="yt_zhengwen" style="width: 100%;">
                {% for item in file_list %}
                    {% if item.file_type == '0' %}
                        <div><a href="#" title="{{ item.file_name }}" class="a_tag_cla" onclick="chage_yulan(this, '{{ item.file_path }}')">{{ item.file_name }}</a></div>
                    {% endif %}
                {% endfor %}
            </div>
            {% if flag == 'true' %}
                <div style="width: 100%;height: 40px;background: #c8cbcf;padding-left: 2%;line-height: 40px;color: #0c6fd9;">
                    盖章文件
                </div>
                <div id="yt_zhengwen1" style="width: 100%;">
                    {% for item in file_list %}
                        {% if item.file_type == '1' %}
                            <div><a href="#" title="{{ item.file_name }}" class="a_tag_cla" onclick="chage_yulan(this, '{{ item.file_path }}')">{{ item.file_name }}</a></div>
                        {% endif %}
                    {% endfor %}
                </div>
            {% endif %}
        </div>
        <div style="display: inline-block;width: 78%;vertical-align: top;height: 99%;text-align: center;" id="fujian">
            {% if 'jpg' in file_path or 'JPG' in file_path or 'JPEG' in file_path or 'jpeg' in file_path or 'PNG' in file_path or 'png' in file_path %}
                <img src="{{ file_path }}" alt="" style="width: 800px;height: 100%;">
            {% else %}
                <embed id="embed_file" src="{{ file_path }}" type="application/pdf" style="width: 100%;height: 100%;">
            {% endif %}
        </div>
    </div>

    <div id="lct" style="width: 100%;height: 94%;background: white;display: none;">
        <div style="width: 100%;height: 40%;text-align: center;margin: 20% auto;">
            <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                <div style="text-align: center;color: #0d8ddb;">
                    ({{ obj.apply_user.real_name }})<br>
                    发起人
                </div>
                <div style="width: 50px;height: 25px;border-radius: 3px;background: #0d8ddb;color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                    start
                </div>
            </div>

            {% if 'one' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'one' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 70px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                科室负责人
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'two' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'two' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 70px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                物资需求科室
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'three' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'three' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 70px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                财务科负责人
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'four' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'four' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 70px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                监察室负责人
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'five' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'five' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 70px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                审计科负责人
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'six' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'six' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 70px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                分管领导审核
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'nine' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'nine' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 70px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                {% if obj.greater == "1" %}
                                    书记审核
                                {% else %}
                                    院长审核
                                {% endif %}
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'ten' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'ten' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 70px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                法人审核
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            {% if 'eleven' in flow_dict %}
                {% for k,v in flow_dict.items %}
                    {% if k == 'eleven' %}
                        <div style="display: inline-block;border: {% if v.apply == 'true' %} #0d8ddb {% else %} #cfcfcf {% endif %} solid 1px;width: 70px;vertical-align: bottom;margin-bottom: 12px;"></div>
                        <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                            <div style="text-align: center;{% if v.apply == 'true' %} color: #0d8ddb; {% endif %}">
                                ({{ v.apply_people }})<br>
                                党政办审核盖章
                            </div>
                            <div style="width: 25px;height: 25px;border-radius: 50%;{% if v.apply == 'true' %} background: #0d8ddb; {% else %} background: #cfcfcf; {% endif %}color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                                {{ v.sear }}
                            </div>
                        </div>
                    {% endif %}
                {% endfor %}
            {% endif %}

            <div style="display: inline-block;border: #0d8ddb solid 1px;width: 70px;vertical-align: bottom;margin-bottom: 12px;"></div>
            <div style="display: inline-block;vertical-align: top;cursor: pointer;text-align: center;">
                <div style="text-align: center;color: #0d8ddb;">
                    <span style="visibility: hidden;">({{ obj.apply_user.real_name }})</span><br>
                    结束
                </div>
                <div style="width: 50px;height: 25px;border-radius: 3px;background: #0d8ddb;color: white;text-align: center;display: inline-block;font-size: 12px;line-height: 25px;">
                    ending
                </div>
            </div>
        </div>
    </div>

    <div id="del_adjunct" style="z-index: 1000;position: fixed;background-color: rgba(36, 36, 36, 0.5);width: 100%;height: 100%;top: 0;left: 0;right: 0;bottom: 0;display: none;">
        <div style="top: 50%;left: 50%;width: 400px;height: 150px;background: white;transform:translate(-50%,-50%);border: #dfdfdf solid 1px;position: absolute;border-radius: 4px;">
            <div style="width: 100%;height: 100px;text-align: center;line-height: 100px;">请查看附件，删除无用的附件！</div>
            <hr>
            <div style="width: 100%;height: 50px;text-align: right;padding-right: 5%;">
                <button onclick="del_adjunct_button()"
                        style="width: 50px;height: 30px;line-height: 30px;margin-top: 10px;background: #00a0e9;color: white;border-radius: 4px;border: #00a0e9 solid 1px;">
                    确认
                </button>
            </div>
        </div>
    </div>

    <div id="selection-office" class="office-shade">
        <div id="office-model">
            <!-- 标题 -->
            <div id="office-title" style="font-size: 14px;line-height: 40px;">
                选择科室
                <span onclick="close_office_models()" style="float: right;padding-right: 2%;cursor: pointer;"><i class="iconfont icon-quchu"></i></span>
            </div>
            <hr>
            <div style="width: 55%;height: 350px;vertical-align: top;left: 0;display: inline-block;border-right: #cfcfcf solid 1px;">
                <div style="width: 100%;height: 50px;line-height: 50px;padding-left: 2%;">
                    <input id="search_data1" onkeydown="search_dep()" class="search-input" type="text" placeholder="搜索" autocomplete="off" style="width: 85%;">
                </div>
                <div id="processed" style="width: 100%;height: 300px;overflow: auto;">
                    {% for company in company_list %}
                        <div style="width: 100%;height: 30px;line-height: 30px;font-size: 14px;color: #0b0b0b;">
                            <input class="check_box1" id="{{ company.id }}" type="checkbox" onclick="check_dep_ff('{{ company.name }}', '{{ company.id }}', false)"> {{ company.name }}
                        </div>
                    {% endfor %}
                </div>
            </div>

            <div style="width: 43%;height: 360px;vertical-align: top;left: 0;display: inline-block;">
                <div style="width: 100%;height: 50px;line-height: 50px;padding-left: 2%;font-size: 14px;">
                    已选择科室
                </div>
                <div id="processed_prople" style="width: 100%;height: 265px;overflow: auto;padding-left: 2%;">

                </div>
                <div style="width: 100%;height: 40px;text-align: center;">
                    <button onclick="summit_val()" style="border-radius: 2px;height: 30px;margin-top: 5px;border: #1E90FF solid 1px;background: #1E90FF;color: white;width: 80px;letter-spacing: 4px;font-size: 14px;">
                        提交
                    </button>
                    <button onclick="close_office_models()" style="border-radius: 2px;height: 30px;margin-top: 5px;border: #cfcfcf solid 1px;width: 80px;letter-spacing: 4px;margin-left: 15px;font-size: 14px;">
                        取消
                    </button>
                </div>
            </div>
        </div>
    </div>

    <script src="../../static/system_setup/creat_from/js/jquery-1.10.2.js"></script>
    <script src="../../static/administrative/layDate-v5.0.9/laydate/laydate.js"></script> <!-- 改成你的路径 -->
    <script type="text/javascript" src="../../static/public_file/js/DepartmentSelection.js"></script>
    <script>
        window.onload = function () {
            document.getElementById("loading").style.display = "none";
        }
        lay('#version').html('-v' + laydate.v);
        //执行一个laydate实例
        laydate.render({
            elem: '#contract_effect', //指定元素
            type: 'date',
            format: 'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#contract_off', //指定元素
            type: 'date',
            format: 'yyyy-MM-dd'
        });

        var uuid = "{{ obj.fj_number }}"
        function change_mind(ele_id) {
            if (ele_id === "DW") {
                document.getElementById("DW").style.display = "inline-block";
                document.getElementById("DW_tag").className = "tab_top top_tag";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
                document.getElementById("lct_tag").className = "tab_top";
                document.getElementById("lct").style.display = "none";
            } else if (ele_id === "LH"){
                document.getElementById("LH").style.display = "inline-block";
                document.getElementById("LH_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("lct_tag").className = "tab_top";
                document.getElementById("lct").style.display = "none";
            }else {
                document.getElementById("lct").style.display = "inline-block";
                document.getElementById("lct_tag").className = "tab_top top_tag";
                document.getElementById("DW_tag").className = "tab_top";
                document.getElementById("DW").style.display = "none";
                document.getElementById("LH_tag").className = "tab_top";
                document.getElementById("LH").style.display = "none";
            }
        }

        // 修改
        function ExportCar() {
            var administrative_table = document.getElementById('party_main');
            if (!administrative_table.children.length) {
                alert("请上传附件！");
                return false
            }
            var product_company = document.getElementById('product_company').innerText;
            if (!product_company) {
                alert("请选择物资需求科室！");
                return false
            }
            var contract_type = document.getElementById("contract_type").value;

            var product_company_id = $("#product_company").attr("name")
            var contract_name = document.getElementById('contract_name').innerText;
            var contract_number = document.getElementById('contract_number').innerText;
            var documentation = document.getElementById('documentation').innerText;
            var other_units = document.getElementById('other_units').innerText;
            var contract_amount = document.getElementById('contract_amount').innerText;
            var source = document.getElementById('source').innerText;
            var content = document.getElementById('content').innerText;
            var Printing = document.getElementById('Printing').innerText;
            var contract_effect = document.getElementById("contract_effect").innerText;
            var contract_off = document.getElementById("contract_off").innerText;

            if (contract_type === "0"){
                alert('请选择合同类型！')
                return false
            }
            if (contract_type === "1") {
                if (!contract_effect) {
                    alert('合同生效日不能为空！')
                    return false
                }
                if (!contract_off) {
                    alert("合同截至日不能为空！");
                    return false
                }
            }

            document.getElementById("loading").style.display = "inline-block";
            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/finance/business_contract_index_view", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send("product_company_id=" + String(product_company_id) + "&id=" + String({{obj.id}}) + "&contract_name=" + String(contract_name) + "&contract_number=" + String(contract_number) + "&documentation=" + String(documentation) + "&other_units=" + String(other_units) + "&contract_amount=" + String(contract_amount) + "&source=" + String(source) + "&content=" + String(content) + "&uuid=" + String(uuid)+"&xiugai=admin"+"&Printing="+String(Printing)+"&contract_effect="+String(contract_effect)+"&contract_off="+String(contract_off)+"&contract_type="+contract_type);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        var JsonDate = JSON.parse(xhr.responseText);
                        if (JsonDate["code"] === 200) {
                            alert("创建成功");
                            window.location = "ContractCountersignatureList.html";
                            document.getElementById("loading").style.display = "none";
                        } else {
                            alert(JsonDate['message']);
                            document.getElementById("loading").style.display = "none";
                        }
                    }
                }
            };
        }

        function chage_yulan(this_, file_path) {
            var fujian = document.getElementById("fujian");
            var file_index = file_path.lastIndexOf(".")
            var ext = file_path.substring(file_index+1)
            var arr=['jpg', 'JPG', "JPEG", "jpeg", "PNG", "png"];
            var ext_index=arr.indexOf(ext);
            if (ext_index === -1){
                fujian.innerHTML = '<embed id="embed_file" src="'+file_path+'" type="" style="width: 100%;height: 100%;">'
            }else {
                fujian.innerHTML = '<img src="' + file_path + '" alt="application/pdf" style="width: 800px;height: 100%;">'
            }

            var a_tag_list = document.getElementsByClassName("a_tag_cla");
            for (var i = 0;i<a_tag_list.length; i++){
                a_tag_list[i].style.background='';
            }
            this_.style.background='#cfcfcf';
        }

        function myclick1() {
            var selecteddiv = document.getElementById("selectdiv_1");
            selecteddiv.style.display = "block";
        }

        function mousein1() {
            var selecteddiv = document.getElementById("selectdiv_1");
            selecteddiv.style.display = "block";
        }

        //鼠标离开多选框的div【selectdiv】
        function mouseout1() {
            var selecteddiv = document.getElementById("selectdiv_1");
            selecteddiv.style.display = "none";
        }

        //checkbox的点击事件
        function mycheck1(obj) {
            var checked_list = document.getElementsByClassName("check_anniu");
            var checked_value = []
            if (obj.checked) {
                for (var t = 0; t < checked_list.length; t++) {
                    if (checked_list[t].checked) {
                        checked_value.push(checked_list[t].value)
                    }
                }
            }
            document.getElementById("selectButton_1").value = checked_value.join(", ");
        }

        // 删除附件
        function RemoveTr(_this, tbody_id, wj_id) {
            var table = document.getElementById(tbody_id);
            var trNode = $(_this).parent().parent();
            trNode.remove();

            for (var i=0; i<table.children.length; i++){
                table.children[i].children[0].innerHTML=i+1;
            }

            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/delete_attachments_view", true);
            xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
            xhr.send("id="+String(wj_id));
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        alert("删除成功！")
                    }
                }
            };
        }

        // 上传附件
        function upload_accessory(file_type, tbody_id, accessory_type) {
            document.getElementById("loading").style.display = "inline-block";
            var form = new FormData();
            var files = document.getElementById(accessory_type).files[0];
            form.append(file_type, files);
            form.append('number', "{{ obj.fj_number }}")
            form.append('source', 'yysq');
            form.append('admin', 'true');

            var xhr = new XMLHttpRequest();
            var local_host = window.location.host;          // 获取当前IP
            xhr.open('post', "/administrative/topics_attachments_upload", true);
            xhr.send(form);
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    if (xhr.status === 200) {
                        document.getElementById("loading").style.display = "none";
                        var JsonDate = JSON.parse(xhr.responseText);
                        console.log(JsonDate);
                        creat_table(JsonDate, tbody_id)
                    }
                }
            };
        }

        // 创建附件列表
        function creat_table(JsonData, tbody_id) {
            var t_table = document.getElementById(tbody_id);
            var t_table1 = document.getElementById("regular_main1");
            var local_host = window.location.host;
            if (Array.isArray(JsonData["pdf_path"])) {
                for (var i = 0; i < JsonData["pdf_path"].length; i++) {
                    var tr = document.createElement("tr");var td1 = document.createElement("td");var td2 = document.createElement("td");var td3 = document.createElement("td");var td4 = document.createElement("td");var td5 = document.createElement("td");var td6 = document.createElement("td");
                    td1.innerHTML = t_table.children.length + 1;td1.style.textAlign = "center";td1.style.border = "#cccccc solid 1px";td1.style.borderTop = "none";
                    td2.innerHTML = JsonData["file_name"];td2.style.paddingLeft = "1%";td2.style.border = "#cccccc solid 1px";td2.style.borderLeft = "none";td2.style.borderTop = "none";
                    td3.innerHTML = JsonData["file_size"];td3.style.textAlign = "center";td3.style.border = "#cccccc solid 1px";td3.style.borderLeft = "none";td3.style.borderTop = "none";
                    td4.innerHTML = JsonData["upload_time"];td4.style.textAlign = "center";td4.style.border = "#cccccc solid 1px";td4.style.borderLeft = "none";td4.style.borderTop = "none";
                    td5.innerHTML = JsonData["uploader"];td5.style.textAlign = "center";td5.style.border = "#cccccc solid 1px";td5.style.borderLeft = "none";td5.style.borderTop = "none";
                    td6.innerHTML = "<a target='_blank' href='" + JsonData["pdf_path"][i]["pdf_path"] + "'>查看</a> | <a style='color: red;' href='#' onclick='RemoveTr(this, \"" + tbody_id + "\", \"" + JsonData["pdf_path"][i]["id"] + "\")'>删除</a>";
                    td6.style.textAlign = "center";td6.style.border = "#cccccc solid 1px";td6.style.borderLeft = "none";
                    tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td5);tr.appendChild(td6);
                    if (JsonData["file_type"] === "0") {
                        t_table.appendChild(tr);
                    }else {
                        t_table1.appendChild(tr);
                    }
                }
                if (JsonData["pdf_path"].length > 1) {
                    document.getElementById("del_adjunct").style.display = 'block';
                }
            } else {
                tr = document.createElement("tr");td1 = document.createElement("td");td2 = document.createElement("td");td3 = document.createElement("td");td4 = document.createElement("td");td5 = document.createElement("td");td6 = document.createElement("td");
                td1.innerHTML = t_table.children.length + 1;td1.style.textAlign = "center";td1.style.border = "#cccccc solid 1px";td1.style.borderTop = "none";
                td2.innerHTML = JsonData["file_name"];td2.style.paddingLeft = "1%";td2.style.border = "#cccccc solid 1px";td2.style.borderLeft = "none";td2.style.borderTop = "none";
                td3.innerHTML = JsonData["file_size"];td3.style.textAlign = "center";td3.style.border = "#cccccc solid 1px";td3.style.borderLeft = "none";td3.style.borderTop = "none";
                td4.innerHTML = JsonData["upload_time"];td4.style.textAlign = "center";td4.style.border = "#cccccc solid 1px";td4.style.borderLeft = "none";td4.style.borderTop = "none";
                td5.innerHTML = JsonData["uploader"];td5.style.textAlign = "center";td5.style.border = "#cccccc solid 1px";td5.style.borderLeft = "none";td5.style.borderTop = "none";
                td6.innerHTML = "<a target='_blank' href='" + JsonData["pdf_path"] + "'>查看</a> | <a style='color: red;' href='#' onclick='RemoveTr(this, \"" + tbody_id + "\", \"" + JsonData["id"] + "\")'>删除</a>";
                td6.style.textAlign = "center";td6.style.border = "#cccccc solid 1px";td6.style.borderLeft = "none";td6.style.borderTop = "none";
                tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);tr.appendChild(td6);
                if (JsonData["file_type"] === "0") {
                        t_table.appendChild(tr);
                    }else {
                        t_table1.appendChild(tr);
                    }
            }
        }

        function choose_contract() {
            var contract_type = document.getElementById("contract_type").value;
            if (contract_type === "1") {
                document.getElementById("contract_date").style.display = 'table-row';
            }else {
                document.getElementById("contract_date").style.display = 'none';
            }
        }

        function summit_val() {
            var processed_prople = document.getElementsByClassName("selected-department");
            var dep_list = [];
            for (var i=0; i<processed_prople.length; i++) {
                dep_list.push(processed_prople[i].innerText.split("(")[0])
            }
            document.getElementById("product_company").innerText=dep_list.join();
            close_office_models()
        }

        function close_office_models() {
            document.getElementById("selection-office").style.display = "none";
        }
    </script>
</body>
</html>